#!/bin/bash -x

cd $(dirname $0)

if [ "$1" == "" ] ; then

	git add .;
	git commit -m "add some file" ;
	git push -u mayun master
	git push -u origin master

elif [ "$1" == "make" ] ; then

	ls *md | while read file; do
		if [ "$file" == "index.md" ]; then
			continue;
		fi

		if [ "$file" == "README.md" ]; then
			echo "+ [README](/cblog/TREADME.html)";
			continue;
		fi

		file=${file%.md}
		echo "+ [$file](/cblog/$file.html)"

	done > index.md

fi

